﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PeekWebApp.handler
{
    /// <summary>
    /// LogOutHandler 的摘要说明
    /// </summary>
    public class LogOutHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";            
            context.Response.Cookies["user"].Expires=DateTime.Now.AddHours(-1);
            try
            {
                context.Response.Write(context.Request.UrlReferrer.ToString());//返回上次请求的地址
            }
            catch
            {
                context.Response.Write(context.Request.RawUrl.ToString());//返回当前请求的地址
            }           
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}